<?php

$dbConn = mysql_connect("localhost:3308","root","pass"); // or die (mysql_error());

if($dbConn){
$createDB = mysql_query("CREATE DATABASE foodmenu", $dbConn); // or die (mysql_error());
if($createDB){
$dbSel = mysql_select_db("foodmenu", $dbConn); // or die (mysql_error());
if($dbSel){

$f_Table = mysql_query("CREATE TABLE food(ID int, Name varchar(20), Price int)") or die (mysql_error());

$d_Table = mysql_query("CREATE TABLE drinks(ID int, Name varchar(20), Price int)") or die (mysql_error());

$sn_Table = mysql_query("CREATE TABLE snacks(ID int, Name varchar(20), Price int)") or die (mysql_error());

$sv_Table = mysql_query("CREATE TABLE services(ID int, Name varchar(20), Price int)") or die (mysql_error());

$user = mysql_query("CREATE TABLE user(Name varchar(20), UserName varchar(20), Password varchar(20))") or die (mysql_error());

$passWd = mysql_query("CREATE TABLE pwd(Category varchar(20), Password varchar(20), Username varchar(20))") or die (mysql_error()); 


/*$Placed_order = mysql_query("CREATE TABLE placedorder(ID int NOT NULL AUTO_INCREMENT PRIMARY KEY, Custid varchar(20), CustName varchar(20), CustTable varchar(20), order varchar(20), Price int, ReceiptNo varchar(20), date varchar(20))") or die (mysql_error());*/

$Orders_Placed = mysql_query("CREATE TABLE orderplaced(ID int NOT NULL AUTO_INCREMENT PRIMARY KEY, Custid varchar(20), CustName varchar(20), CustTable varchar(20), orderr varchar(20), Price int,  ReceiptNo varchar(20), date varchar(20))") or die (mysql_error());

$Orders_Processed = mysql_query("CREATE TABLE processedorder(ID int NOT NULL AUTO_INCREMENT PRIMARY KEY, Custid varchar(20), CustName varchar(20), CustTable varchar(20), orderr  varchar(20), Price int, ReceiptNo varchar(20), date varchar(20), Cashier varchar(20))") or die (mysql_error());

$Orders_Paid = mysql_query("CREATE TABLE Orders_Paid(ID int NOT NULL AUTO_INCREMENT PRIMARY KEY, OrderID varchar(20), receiptNo varchar(20), custName varchar(20), tableName varchar(20), Contents  varchar(20), Price int, Date varchar(20), cashierName varchar(20))") or die (mysql_error());

$Cust_Graph = mysql_query("CREATE TABLE Cust_Graph(Date varchar(20), numCust int)") or die (mysql_error());

$Sales_Graph = mysql_query("CREATE TABLE Sales_Graph(Date varchar(20), Sales int)") or die (mysql_error());

$Workers = mysql_query("CREATE TABLE Sales_Graph(Date varchar(20), Sales int)") or die (mysql_error());

}else{
echo "Failed to select the Database!!";
}

}else{
echo "Failed to connect to create Database!!";
}

}else{
echo "Failed to connect to Server!!";
}








?>